package com.lottery.ruok.lottrey.activity;

import android.os.Bundle;
import android.widget.TextView;

import com.lottery.ruok.lottrey.R;
import com.lottery.ruok.lottrey.retrofitModule.RetrofitBase;
import com.lottery.ruok.lottrey.retrofitModule.RxHelper;
import com.lottery.ruok.lottrey.retrofitModule.RxSubscribe;
import com.lottery.ruok.lottrey.retrofitModule.request.PayDescRequest;
import com.lottery.ruok.lottrey.retrofitModule.response.PayDescResponse;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by ASUS on 2017/8/9.
 * 充值说明
 */

public class ChargeExplainActivity extends BaseActivity {
    @BindView(R.id.content)
    TextView content;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_charge_explain);
        ButterKnife.bind(this);

        init();
    }

    private void init() {
        RetrofitBase.getRetrofit().create(PayDescRequest.class).getResult()
                .compose(RxHelper.<PayDescResponse>handleResult())
                .subscribe(new RxSubscribe<PayDescResponse>(this) {
                    @Override
                    protected void _onNext(PayDescResponse payDescResponse) {
                        content.setText(payDescResponse.getDesc());
                    }

                    @Override
                    protected boolean showDialog() {
                        return false;
                    }
                });
    }
}
